<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block header %}
<meta name="description" content="诗玥的世界是一个个人成长博客，记录诗玥的成长历程，所感所想">
{% endblock %}
<title>
    {% block title %}
        {{ site_name }}
    {% endblock %}
</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style/style.css') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='icon/css/open-iconic.css') }}">
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    {% block style %}{% endblock %}
<!--script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script-->
<script type="text/javascript">
   /*wx.config({
    debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
    appId: '{{ appid }}', // 必填，公众号的唯一标识
    //timestamp:{{ timestamp }}, // 必填，生成签名的时间戳
    nonceStr: '{{ noncestr }}', // 必填，生成签名的随机串
    signature: '{{ signature }}',// 必填，签名，见附录1
    jsApiList: [
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone'
    ]
 });
   wx.ready(function(){
       wx.checkJsApi({
            jsApiList: ['onMenuShareTimeline'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
           success: function(res) {
        // 以键值对的形式返回，可用的api值true，不可用为false
        // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
    }
 });
       wx.onMenuShareTimeline({
           title: 'Shiyue Share', // 分享标题
           link: '{{ url }}', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
           imgUrl: 'http://www.fangshiyue.com{{ url_for('static', filename='images/icon.jpg') }}', // 分享图标
           trigger:function(res){
               alert('Begin');
           },
           success: function () {
              alert('Shared');
           },
           cancel: function () {
        // 用户取消分享后执行的回调函数
              alert('Share canceled');
           }
        });

{#       wx.onMenuShareTimeline({#}
{#      title: '互联网之子',#}
{#      link: 'http://movie.douban.com/subject/25785114/',#}
{#           link: '{{ url }}',#}
{#      imgUrl: 'http://www.fangshiyue.com{{ url_for('static', filename='images/icon.jpg') }}',#}
{#      trigger: function (res) {#}
{#        // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回#}
{#        alert('用户点击分享到朋友圈');#}
{#      },#}
{#      success: function (res) {#}
{#        alert('已分享');#}
{#      },#}
{#      cancel: function (res) {#}
{#        alert('已取消');#}
{#      },#}
{#      fail: function (res) {#}
{#        alert(JSON.stringify(res));#}
{#      }#}
{#    });#}
   });*/
</script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <a class="navbar-brand" href="/"><h3>{{ site_name }}</h3></a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
        <li class="nav-item {% if request.path=='/post/' %}{{ 'active' }}{% endif %}"><a href="/post" class="nav-link">成长</a></li>
        <li class="nav-item {% if request.path=='/reader/' %}{{ 'active' }}{% endif %}"><a href="{{ url_for('reader.index') }}" class="nav-link">玥读</a></li>
        {% if g.user.is_authenticated %}
        <li class="nav-item {% if request.path=='/image/' %}{{ 'active' }}{% endif %}"><a href="/image" class="nav-link">资源</a></li>
        {% endif %}
        <li class="nav-item {% if request.path=='/about' %}{{ 'active' }}{% endif %}"><a href="/about" class="nav-link">我</a></li>
    </ul>
{#    <form class="form-inline my-2 my-lg-0">#}
{#      <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">#}
{#      <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>#}
{#    </form>#}
      <ul class="nav navbar-nav navbar-right">
          {% if not g.user.is_authenticated %}
              <li class="nav-item"><a href="{{ url_for('login') }}" class="nav-link">
                  <span class="oi" data-glyph="account-login" title="登录" aria-hidden="true"></span>
              </a></li>
          {% else %}
              <li class="nav-item"><span class="navbar-text">欢迎您，<b>{{ g.user.name }}</b></span></li>
              <li class="nav-item"><a href="{{ url_for('post.add') }}" class="nav-link">创建</a></li>
              <li class="nav-item"><a href="{{ url_for('logout') }}" class="nav-link">
                  <span class="oi" data-glyph="account-logout" title="退出" aria-hidden="true"></span>
              </a></li>
          {% endif %}
      </ul>
  </div>
</nav>
<div class="container" style="margin-top:10px;">
    <div class="row">
        <div class="col-md-9">
            {% block body %}{% endblock %}
        </div>
        <div class="col-md-3">
{#            {% block qrcode %}#}
{#                <img src="{{ url_for('qr') }}" width="100%" />#}
{#            {% endblock %}#}
            {% if latest != False %}
            <dl>
                <dt>最新日记</dt>
                {% for p in latest %}
                    <dd><a href="{{ url_for('show', id=p.id) }}">{{ p.title }}</a></dd>
                {% endfor %}
            </dl>
            {% endif %}
        </div>
    </div>
    <hr/>
    <div class="footer" data-scroll-reveal="enter from the bottom">
	    <p>&copy;&nbsp;{{ copy_right }} 诗玥 <a href="https://beian.miit.gov.cn">蜀ICP备17022829号</a></p>
    </div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="{{ url_for('static', filename='script/scrollReveal.js') }}"></script>
<script>
(function(){
	window.scrollReveal = new scrollReveal({ reset: false, move: '50px'});
})();
</script>
{% block footer %}{% endblock %}
</body>
</html>
